package cn.scxy.bookcity.controller;


import cn.scxy.bookcity.pojo.entity.Provincial;
import cn.scxy.bookcity.service.IProvincialService;
import cn.scxy.bookcity.web.JsonResult;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@Api(tags = "省份模块")
@RequestMapping("/provincial")
@RestController
public class ProvincialController {
    @Autowired
    IProvincialService provincialService;

    @ApiOperation("省份列表")
    @ApiOperationSupport(order = 100)
    @GetMapping("/list")
    public JsonResult<List<Provincial>> list(){
        List<Provincial> list = provincialService.list();
        return JsonResult.ok(list);
    }
}
